package day03;
//分支结构if演示
public class If {
    public static void main(String[] args) {
//         double $ = 500;//带数（500）
//         if ($>=500){
//             $ *=0.8;
//         }
//        System.out.println("消费："+$);
//
//         int score = 99;//带数（99）
//         if (score>=0 && score<=100){
//             System.out.println("成绩合法");
//         }
//        System.out.println("继续执行...");
//         if (score>=0 && score<=100){
//             System.out.println("成绩合法");
//         }
//        System.out.println("继续执行...");
/*
        double price = 600.0;
        if (price>=500){
                price *=0.8;
        }else {
            price *=0.9;
        }
        System.out.println("消费"+price);
        double xiaofei = 400.0;
        if (xiaofei>=500){
                xiaofei *=0.8;
        }else {
            xiaofei *=0.9;
        }
        System.out.println("消费"+xiaofei);

        int score = 99;
        if (score>=0 && score<=100){
            System.out.println(score+"成绩合法");
        }else {
            System.out.println(score+"成绩不合法");
        }
        int chengji = 101;
        if (chengji>=0 && chengji<=100){
            System.out.println(chengji+"是合法成绩");
        }else {
            System.out.println(chengji+"是不合法成绩");
        }
 */
/*
         double price = 6000.0;
                 if (price>=2000){
                        price *=0.5;
                 }else if (price>=1000 && price<=2000) {
                     price *=0.7;
                 }else  if (price >= 500 && price<=1000){
                     price *=0.8;
                 }else  if(price<500){
                        price *=0.9;
                 }
        System.out.println("最终消费金额"+price);
 */
        //简化版
        double price = 499.0;
        if (price>=2000){
                price*=0.5;
        }else  if (price>=1000){
            price*=0.7;
        }else  if (price>=500){
                price*=0.8;
        }else {
            price*=0.9;
        }
        System.out.println("消费"+price);

        int a=11;
        if (a>0 ){
            System.out.println(a+"是正数");
        }else {
            System.out.println(a+"是负数");
        }
    }
}
